package com.g8.pethospitallearnbackend.exception;

import com.g8.pethospitallearnbackend.utils.responseUtil.ResponseStatusEnum;
import lombok.Data;

@Data
public class NoDataException extends RuntimeException{
    private int code = Integer.MIN_VALUE;

    public NoDataException(ResponseStatusEnum responseCode) {
        super(responseCode.getMsg());
        this.code = responseCode.getCode();
    }
    // 数据库中未查询到相关数据
    public NoDataException(){
        super(ResponseStatusEnum.DATA_NOT_EXIST.getMsg());
        this.code = ResponseStatusEnum.DATA_NOT_EXIST.getCode();
    }
    // Getter 方法
    public int getCode() {
        return code;
    }
}
